<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>账户登录</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <script src="${pageContext.request.contextPath}/jquery/jquery-3.6.0/jquery-3.6.0.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/bootstrap-4.6.0/js/bootstrap.min.js"></script>

    <style>
        y {
            padding-top: 100px;
            padding-bottom: 40px;
            background-color: #eee;
        }
        .a{
            height: 130px;
        }
        .form-signin {
            max-width: 330px;
            padding: 15px;
            margin: 0 auto;
        }
        .form-signin
        .form-signin .checkbox {
            margin-bottom: 10px;
        }
        .form-signin .checkbox {
            font-weight: normal;
        }
        .form-signin .form-control {
            position: relative;
            height: auto;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding: 10px;
            font-size: 16px;
        }
        .form-signin .form-control:focus {
            z-index: 2;
        }
        .form-signin input[type="email"] {
            margin-bottom: -1px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;
        }
        .form-signin input[type="password"] {
            margin-bottom: 10px;
            border-top-left-radius: 0;
            border-top-right-radius: 0;
        }
    </style>
    <script>
        function a4() {
            $.ajax({
                type: "post",
                url:"${pageContext.request.contextPath}/a4",
                data:{'userID':$("#userID").val()},
                success:function (data) {
                    if (data.toString()==="OK"){
                        $("#userInfo").css("color","green");

                    }else {
                        $("#userInfo").css("color","red");
                    }
                    $("#userInfo").html(data);
                }
            })
        }
    </script>
</head>
<div class="text-center">
<div class="a"></div>
<div class="">
    <form class="form-signin" action="${pageContext.request.contextPath}/login">
        <img class="mb-4 img-thumbnail" src="${pageContext.request.contextPath}/pic/yiliao.jpg" width="72" height="72">
        <h1 class="h3 mb-3 font-weight-normal">账户登录</h1>
        <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
        <span id="userInfo" style="font-size:20px;"></span>
        </label><input type="text" onblur="a4()" id="userID" name="userID" class="bi bi-person-circle form-control" placeholder="账号"  required autofocus>
        <input type="password" id="password" name="password" class="form-control" placeholder="密码" required>
        <span style="font-size:20px;color:red;">${msg}</span>
        身份：
        <label class="radio-inline">
            <input type="radio" name="identity" value="用户" checked>用户
        </label>
        <label class="radio-inline">
            <input type="radio" name="identity" value="管理员">管理员
        </label>
        <div class="checkbox mb-3">
            <label>
                <a href="${pageContext.request.contextPath}/toregist">注册</a>
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
        <p class="mt-5 mb-3 text-muted">&copy;2021-YongXin</p>
    </form>
</div>
</div>
</body>
</html>


